//
//  UILabel+Extension.swift
//  WeiBo
//
//  Created by chenguanglei on 16/11/25.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

extension UILabel{

    convenience init(labelText:String?,labelFont:CGFloat?,textColor:UIColor?,align: NSTextAlignment,isSingleLine:Bool = false) {
        
        self.init()
        
        self.text = labelText
        
        if let labelFont = labelFont {
            
            self.font = UIFont.systemFont(ofSize: labelFont)
            
        }
        
        
        if let textColor = textColor {
            
            self.textColor = textColor
            
        }
        
        
        if isSingleLine {
            
            self.numberOfLines = 1
        }else{
        
            self.numberOfLines = 0
        }
        
        
        self.textAlignment = align
        
    }



}
